package com.uni.exp6.dao;

import com.uni.exp6.pojo.Provider;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class ProviderMapperImpl implements ProviderMapper{
    @Autowired
    private SqlSessionTemplate sqlSession;
    @Override
    public List<Provider> queryAllProvider() {
        ProviderMapper mapper = sqlSession.getMapper(ProviderMapper.class);
        return mapper.queryAllProvider();
    }

    @Override
    public List<Provider> queryProviderByName(String proName) {
        ProviderMapper mapper = sqlSession.getMapper(ProviderMapper.class);
        return mapper.queryProviderByName(proName);
    }

    @Override
    public int addProvider(Provider provider) {
        return 0;
    }

    @Override
    public int deleteProviderById(Integer id) {
        return 0;
    }

    @Override
    public int updateProvider(Provider provider) {
        return 0;
    }
}
